include (ValaVersion)

include (ValaPrecompile)

find_package (Vala REQUIRED)

add_definitions (${DEPS_CFLAGS})

link_libraries (${DEPS_LIBRARIES} ${LIBTINYC_LIB})

if(NOT WIN32)
    link_libraries (dl)
endif()

link_directories (${DEPS_LIBRARY_DIRS})

include_directories(${LIBTINYC_INCLUDE_DIR})

set (APP_SOURCES 
     main.vala
     dir_explore.vala
     logger.vala
     auto_test.vala 
     backend.vala
     serialport.vala
     )

vala_precompile (VALA_C auto
    ${APP_SOURCES}
PACKAGES
	${VALA_PACKAGES} posix
GENERATE_VAPI
    libauto
CUSTOM_VAPIS
    tcc.vapi
OPTIONS
    --target-glib 2.32
)

add_library (auto ${VALA_C})
